﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BudgetMealsModels.Entities;
using BudgetMealsModels.Abstract;

namespace BudgetMealsModels.Concrete
{
    public class EFDbCommentRepository : ICommentRepository
    {
        private EFDbContext _context = EFDbContext.Context;

        public IQueryable<Comment> Comments
        {
            get { return _context.Comments.Include("HierarchicalComments").Include("Recipe"); }
        }

        public void Delete(Comment comment)
        {
            if (comment != null)
            {
                _context.Comments.Remove(comment);
            }
            _context.SaveChanges();
        }
        public void AddComment(Comment comment)
        {
            throw new NotImplementedException();
        }
    }
}
